<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Page
 * @copyright  Copyright Hire-Experts LLC
 * @license    http://www.hire-experts.com
 * @version    $Id: Edit.php 2010-08-31 16:05 idris $
 * @author     Idris
 */

/**
 * @category   Application_Extensions
 * @package    Page
 * @copyright  Copyright Hire-Experts LLC
 * @license    http://www.hire-experts.com
 */

class Page_Form_Edit extends Fields_Form_Standard
{
	public function init()
  {
  	parent::init();
  	
    $this
    	->setTitle('')
      ->setMethod('post')
      ->setAttrib('id', 'page_edit_form_info')
      ->setAttrib('class', 'page_edit_form hidden');
    
    $this->addElement('Hidden', 'edit', array('value' => 'info'));
    
    $subform = new Zend_Form_SubForm(array(
      'name' => 'extra',
      'order' => -1000000,
      'decorators' => array(
        'FormElements',
      )
    ));
    
    Engine_Form::enableForm($subform);

    $subform->addElement('Text', 'title', array(
      'label' => 'Title *',
      'allowEmpty' => false,
      'required' => true,
    	'order' => -100,
      'validators' => array(
        array('NotEmpty', true),
        array('StringLength', false, array(1, 64)),
      ),
      'filters' => array(
        'StripTags',
        new Engine_Filter_Censor(),
        new Engine_Filter_EnableLinks(),
      ),
    ));

    $subform->addElement('Textarea', 'description', array(
      'label' => 'Description',
    	'order' => -99,
      'maxlength' => '512',
      'filters' => array(
        new Engine_Filter_Censor(),
        new Engine_Filter_Html(array('AllowedTags' => 'a'))
      ),
    ));

    $subform->addElement('Text', 'country', array(
      'label' => 'Country',
    	'order' => -98,
    	'filters' => array(
        new Engine_Filter_Censor(),
      ),
    ));
    
    $subform->addElement('Text', 'state', array(
      'label' => 'State',
    	'order' => -97,
    	'filters' => array(
        new Engine_Filter_Censor(),
      ),
    ));
    
    $subform->addElement('Text', 'city', array(
      'label' => 'City',
    	'order' => -96,
    	'filters' => array(
        new Engine_Filter_Censor(),
      ),
    ));
    
    $subform->addElement('Text', 'street', array(
      'label' => 'Address',
    	'order' => -95,
    	'filters' => array(
        new Engine_Filter_Censor(),
      ),
    ));
    
    $subform->addElement('Text', 'website', array(
      'label' => 'Website',
    	'order' => -94,
    ));
    
    $subform->addElement('Text', 'phone', array(
      'label' => 'Phone',
      'order' => -93,
    ));
    
    $subform->addElement('Text', 'tags',array(
      'label'=>'Tags (Keywords)',
      'autocomplete' => 'off',
      'description' => 'Separate tags with commas.',
      'filters' => array(
        new Engine_Filter_Censor(),
      ),
    ));
    $subform->tags->getDecorator("Description")->setOption("placement", "append");
    
    $this->addSubForm($subform, $subform->getName());
  }
}
